<template>
  <div class="login_container">
    <el-container>
      <el-header>
        <div class="header_logo"></div>
      </el-header>
    </el-container>
    <div class="login_box">
      <!-- 头像区域 -->
      <div class="avatar_box">
        <img src="../assets/logo.png" alt="" />
      </div>
      <!-- 登录表单区域 -->
      <el-form label-width="55px" class="login_form">
        <!-- 用户名 -->
        <el-form-item label="用户名">
          <el-input v-model="usename" prefix-icon="el-icon-user">
            <el-icon><Avatar /></el-icon>
          </el-input>
        </el-form-item>
        <!-- 密码 -->
        <el-form-item label="密码">
          <el-input v-model="pwd" show-password prefix-icon="el-icon-lock"></el-input>
        </el-form-item>
        <!-- 按钮区域 -->
        <el-form-item style="margin-left: 70px">
          <el-row :gutter="20">
            <el-col :span="5"
              ><el-button type="primary" @click="LoginTo"
                >登录</el-button
              ></el-col
            >
            <el-col :span="5" :offset="10"
              ><el-button type="info">重置</el-button></el-col
            >
          </el-row>

          <!-- <el-row>
                    <el-col :span="10" :offset="5">
                    <el-button type="primary" @click="LoginTo">登录</el-button>
                    </el-col>
                    <el-col :span="5">
                   <el-button type="info">重置</el-button>
                    </el-col>
                </el-row> -->
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      usename: '',
      pwd: ''
    }
  },
  name: 'LoginView',
  methods: {
    LoginTo () {
      this.$router.push('/HomeView')
    }
  }
}
</script>

<style scoped>
.login_container {
  background-color: rgb(194, 215, 247);
  height: 100%;
}
.header_logo {
  width: 110px;
  height: 30px;
  margin-top: 15px;
  background: url("../assets/mylogo.svg");
}
.login_box {
  width: 450px;
  height: 300px;
  background-color: rgba(240, 248, 255, 0.4);
  border-radius: 10px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.avatar_box {
  height: 130px;
  width: 130px;
  border: 1px solid #eee;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 0 10px #ddd;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
}

img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #eee;
}

.login_form {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}
</style>
